package com.eam.core.core.page.app;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.util.List;

/**
 * 表格分页数据对象
 * 
 * @author hjj
 */
@ApiModel("列表数据")
public class AppTableDataInfo implements Serializable
{
    /*	"maxLabelCount": 8,
		"pageNum": 1,
		"pageSize": 2147483647,
		"totalCount": 18,
		"totalPage": 1*/

    private static final long serialVersionUID = 1L;


    /** 总记录数 */
    @ApiModelProperty("总记录数")
    private long totalCount;

    /** 列表数据 */
    @ApiModelProperty("列表数据")
    private List<?> data;

    /** 每页数据量 */
    @ApiModelProperty("每页数据量")
    private int pageSize;

    /** 当前页 */
    @ApiModelProperty("当前页")
    private int pageNum;
    /** 总页数 */
    @ApiModelProperty("总页数")
    private int totalPage;

    /**
     * 表格数据对象
     */
    public AppTableDataInfo()
    {
    }

    public AppTableDataInfo(long totalCount, List<?> data, int pageSize, int pageNum, int totalPage) {
        this.totalCount = totalCount;
        this.data = data;
        this.pageSize = pageSize;
        this.pageNum = pageNum;
        this.totalPage = totalPage;
    }

    /**
     * 分页
     *
     * @param list 列表数据
     * @param total 总记录数
     */
    public AppTableDataInfo(List<?> list, int total)
    {
        this.data = list;
        this.totalCount = total;
    }

    public long getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(long totalCount) {
        this.totalCount = totalCount;
    }

    public List<?> getData() {
        return data;
    }

    public void setData(List<?> data) {
        this.data = data;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    @Override
    public String toString() {
        return "AppTableDataInfo{" +
                "totalCount=" + totalCount +
                ", data=" + data +
                ", pageSize=" + pageSize +
                ", pageNum=" + pageNum +
                ", totalPage=" + totalPage +
                '}';
    }
}
